﻿CREATE PROCEDURE [dbo].[proc_Department_GetList_LCM]
	
	@Companyid INT
	
AS
 DECLARE @mbh varchar(2)
  --select @mbh=mid from company where id=@Companyid
  --select id,dname,case when len(@mbh)=1 then '0'+@mbh else @mbh end + bmbh zzbh from [Department] where companyid=@Companyid AND bmbh IS NOT NULL  order by bmbh

  select id,dname, erp_bh as zzbh,sort,parentid from [Department] 
    
  where companyid=@Companyid
  
   AND erp_bh IS NOT NULL  order by erp_bh